#include <cassert>
#include "car.h"
#include "wheel.h"
#include "server_object_create.h"
#include "ltservershell.h"
#include "serverinterfaces.h"

namespace GameLogic {
    wheel::wheel(HOBJECT obj,
                 car* mcar,
                 int id) :
        m_object(obj),
        m_car(mcar),
        m_id(id) {
    }

    wheel::~wheel() {
        remove_object(m_object) ;
        m_object = 0 ;
        
    }

    void wheel::update() {

        
        LTVector pos ;
        LTRotation rot ;
        
        m_car->wheel_pos_rot(m_id, pos, rot) ;
        //pos.y += 2.5f ; // just for test
        g_pLTServer->SetObjectPos(m_object, &pos) ;
        g_pLTServer->SetObjectRotation(m_object, &rot) ;
        
    }
}

